package com.tzinfo.tzt.activity;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;

import com.tzinfo.tzt.R;
import com.tzinfo.tzt.util.FileTools;
import com.tzinfo.tzt.view.gestureimage.GestureImageView;

public class SeeNoteViewIamge extends Activity {
	private String path = null;
	private GestureImageView imageView;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_view_image);
		path = getIntent().getStringExtra("path");
		imageView = (GestureImageView) this.findViewById(R.id.image);
		BitmapFactory.Options option = new BitmapFactory.Options();
		Bitmap bitmap = BitmapFactory.decodeFile(path);
		option.inSampleSize = FileTools.getInSampleSize(bitmap);
		if (option.inSampleSize > 3) {
			option.inSampleSize -= 3;
		}
		bitmap.recycle();
		bitmap = BitmapFactory.decodeFile(path, option);
		imageView.setImageBitmap(bitmap);
	}
}